package com.iphanta.community.common.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author 墨声 E-mail: zehong.hongframe.huang@gmail.com
 * create time: 2/18/22 11:36 AM
 */
public enum RedisKeyUtils {

    INSTANCE;

    public String key(String... fields) {
        return String.join(":", fields);
    }

    public String[] keys(String p, List s) {
        List<String> keys = new ArrayList<>();
        for (Object s1 : s) {
            keys.add(key(p, String.valueOf(s1)));
        }
        return keys.toArray(new String[s.size()]);
    }

}
